﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class PatronWelcome : System.Web.UI.UserControl
{
    Person person;
    string lib;

    protected void Page_Load(object sender, EventArgs e)
    {
        person = (Person)Session["Person"];
        lib = Request.QueryString["id"].ToString();
        if (!IsPostBack)
        {
            lblWelcome.Text = "Welcome, " + person.FirstName;
        }
    }

    protected void btnLogOut_Click(object sender, EventArgs e)
    {
        Session["Patron"] = null;
        Session["Person"] = null;
        Response.Redirect("Default.aspx?id=" + lib);
    }
}
